<?php
class Layout_Core extends View {
    protected $layoutName;
    
    public function __construct() {
        if (!strlen($this->layoutName)) {
            $this->layoutName = "layouts/".strtolower(str_replace('_Layout','',get_class($this)));
        }
        parent::__construct($this->layoutName);
    }
    
    public function getScripts() {
        $output = "";
        $js = Kohana::list_files('js', TRUE);
        foreach ($js as $j) { 
            $j = str_replace(DOCROOT,url::base(), $j);
            $output.='<script type="text/javascript" src="'.$j.'"></script>'."\n"; 
        }
        return $output;
    }
}